home *** CD-ROM | disk | FTP | other *** search
- /****** Uptime.rexx ************************************************************
- *
- * $VER: Uptime 1.3 (2.12.94) * Copyright © 1993,94 Magnetic Ink
- *
- ********************************************************************************/
-
- padStr = "00"
-
- nowDays = DATE("I")
- nowSecs = TIME("S")
-
- envTime = GETCLIP("Uptime")
-
- IF envTime ~= "" THEN DO
- envDays = WORD(envTime,1)
- envSecs = WORD(envTime,2)
- totDays = nowDays-envDays
- totSecs = nowSecs-envSecs
- DO WHILE totSecs < 0
- totDays = totDays-1
- totSecs = totSecs+86400
- END
- hh = padStr || totSecs % 3600
- mm = padStr || (totSecs // 3600) % 60
- dd = "day"
- IF totDays ~= 1 THEN dd = dd || "s"
- outLine = LEFT(TIME(),5) DELSTR(SPACE(DATE(),1,"-"),8,2)
- SAY outLine " Up" totDays dd || "," RIGHT(hh,2) || ":" || RIGHT(mm,2)
- END
- ELSE CALL SETCLIP("Uptime",nowDays nowSecs)
- EXIT 0
-
- /*
- ** EOF
- */
-